HRename
HRename Rename a file, volume, or directory
#include <Files.h> File Manager
OSErr HRename( vRefNum, dirID, oldName, newName );
short vRefNum; volume or directory reference number
long dirID; ID of directory that oldName resides in
Str255 oldName; address of length-prefixed full or partial old name
Str255 newName; address of length-prefixed full or partial new name
returns Error Code; 0=no error
HRename changes the name of a file or volume. It does NOT move a file from
one directory to another (use PBCatMove for that). It is similar to yet easier
to use than PBReName since it uses a vRefNum and dirID instead of a
ParmBlkRec structure.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
bdNamErr (-37) Bad name
dirFulErr (-33) Directory full
dupFNErr (-48) Duplicate filename (new name already exists)
extFSErr (-58) External file system
fLckdErr (-45) File is locked
fnfErr (-43) File not found
fsRnErr (-59) File system rename error
ioErr (-36) I/O error
nsvErr (-35) No such volume
paramErr (-50) No default volume
vLckdErr (-46) Volume is locked
wPrErr (-44) Diskette is write-protected